<html>
<head><meta charset="utf-8"><title>rustup toolchain link - cargo? · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html">rustup toolchain link - cargo?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="242712769"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242712769" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Oliver Braunsdorf <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242712769">(Jun 15 2021 at 10:11)</a>:</h4>
<p>Hi there,<br>
the rustc dev guide suggests to use <code>rustup toolchain link</code> to make use of your freshly built rustc. However, there is no cargo in the linked toolchain, even if I also run <code>x.py  build cargo</code> (in order to have to correct cargo version associated with the rustc version)</p>
<p>What is the suggested workflow to build your custom rustc compiler and use it with cargo (in its appropriate version) to build test projects with <code>cargo build</code>?</p>



<a name="242713741"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242713741" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242713741">(Jun 15 2021 at 10:22)</a>:</h4>
<p>if you're talking about using the regular cargo and not a custom built one: the rustup toolchain link allows you to use your custom rustc like any other rustup toolchain. So this will work: <code>cargo +yourcustomrustctoolchain build</code></p>



<a name="242714358"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242714358" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Oliver Braunsdorf <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242714358">(Jun 15 2021 at 10:29)</a>:</h4>
<p><span class="user-mention" data-user-id="116113">@lqd</span> if i try this i get the following error: </p>
<div class="codehilite"><pre><span></span><code>error: &#39;cargo&#39; is not installed for the toolchain &#39;custom&#39;
note: this is a custom toolchain, which cannot use `rustup component add`
help: if you built this toolchain from source, and used `rustup toolchain link`, then you may be able to build the component with `x.py`
</code></pre></div>



<a name="242714565"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242714565" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242714565">(Jun 15 2021 at 10:31)</a>:</h4>
<p>your custom toolchain may have an issue, what parameters did you pass to  <code>rustup toolchain link</code> ?</p>



<a name="242714677"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242714677" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242714677">(Jun 15 2021 at 10:32)</a>:</h4>
<p>and does <code>rustc +custom -vV</code> work ?</p>



<a name="242714733"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242714733" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242714733">(Jun 15 2021 at 10:33)</a>:</h4>
<p>and what does <code>rustup toolchain list -v</code> output ?</p>



<a name="242714804"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242714804" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Oliver Braunsdorf <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242714804">(Jun 15 2021 at 10:34)</a>:</h4>
<p>This is the command I used: </p>
<div class="codehilite"><pre><span></span><code>rustup toolchain link custom build/x86_64-unknown-linux-gnu/stage1
</code></pre></div>



<a name="242714873"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242714873" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242714873">(Jun 15 2021 at 10:35)</a>:</h4>
<p>it may need to be an absolute path, we'll see with the results of the other 2 commands</p>



<a name="242715108"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242715108" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Oliver Braunsdorf <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242715108">(Jun 15 2021 at 10:37)</a>:</h4>
<p>here is the output:</p>
<div class="codehilite"><pre><span></span><code>root@3fc5958f7dde:/home/builder/rust# rustc +custom -vV
rustc 1.52.0-dev
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-unknown-linux-gnu
release: 1.52.0-dev
LLVM version: 9.0.0
root@3fc5958f7dde:/home/builder/rust# rustup toolchain list -v
nightly-2019-02-22-x86_64-unknown-linux-gnu (default)   /root/.rustup/toolchains/nightly-2019-02-22-x86_64-unknown-linux-gnu
custom  /home/builder/rust/build/x86_64-unknown-linux-gnu/stage1
</code></pre></div>



<a name="242715162"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242715162" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242715162">(Jun 15 2021 at 10:38)</a>:</h4>
<p>(maybe there's a spurious override in config.toml causing issues)</p>



<a name="242715231"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242715231" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Oliver Braunsdorf <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242715231">(Jun 15 2021 at 10:39)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116113">lqd</span> <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/rustup.20toolchain.20link.20-.20cargo.3F/near/242715162">said</a>:</p>
<blockquote>
<p>(maybe there's a spurious override in config.toml causing issues)</p>
</blockquote>
<p>you mean the config.toml of rustlang/rust repo?</p>



<a name="242715389"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242715389" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242715389">(Jun 15 2021 at 10:41)</a>:</h4>
<p>your local one, that x.py setup created or if you copied it from the config.toml.example in the rust repo</p>



<a name="242715497"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242715497" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242715497">(Jun 15 2021 at 10:42)</a>:</h4>
<p>there are flags to control which tools are built automatically and so on</p>



<a name="242715561"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242715561" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242715561">(Jun 15 2021 at 10:43)</a>:</h4>
<p>but yeah, very weird, this is how it's supposed to work (and how I remember doing it multiple times)</p>



<a name="242715624"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242715624" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242715624">(Jun 15 2021 at 10:44)</a>:</h4>
<p>maybe someone more familiar with bootstrap, infra, and so on will be able to help <span aria-label="sweat" class="emoji emoji-1f613" role="img" title="sweat">:sweat:</span></p>



<a name="242715639"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242715639" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Oliver Braunsdorf <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242715639">(Jun 15 2021 at 10:44)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116113">lqd</span> <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/rustup.20toolchain.20link.20-.20cargo.3F/near/242715497">said</a>:</p>
<blockquote>
<p>there are flags to control which tools are built automatically and so on</p>
</blockquote>
<p>you mean this one?</p>
<div class="codehilite"><pre><span></span><code># Installs chosen set of extended tools if enabled. By default builds all.
# If chosen tool failed to build the installation fails.
#tools = [&quot;cargo&quot;, &quot;rls&quot;, &quot;clippy&quot;, &quot;rustfmt&quot;, &quot;analysis&quot;, &quot;src&quot;]
</code></pre></div>



<a name="242715757"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242715757" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Oliver Braunsdorf <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242715757">(Jun 15 2021 at 10:46)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116113">lqd</span> <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/rustup.20toolchain.20link.20-.20cargo.3F/near/242715561">said</a>:</p>
<blockquote>
<p>but yeah, very weird, this is how it's supposed to work (and how I remember doing it multiple times)</p>
</blockquote>
<p>okay..that's good to know :) then I will look for strange things in my setup. I just needed to know that this really is the way to go. Thank you very much for your help :)</p>



<a name="242715767"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242715767" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242715767">(Jun 15 2021 at 10:46)</a>:</h4>
<p>do you have a built <code>rustc</code> in <code>/home/builder/rust/build/x86_64-unknown-linux-gnu/stage1/bin</code> ?</p>



<a name="242716143"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242716143" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Oliver Braunsdorf <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242716143">(Jun 15 2021 at 10:50)</a>:</h4>
<p>yes..actually, rustc is the only binary in <code>/home/builder/rust/build/x86_64-unknown-linux-gnu/stage1/bin</code> <br>
I expected to have the cargo binary there, too..but it's not there. It's in <code>/home/builder/rust/build/x86_64-unknown-linux-gnu/stage1-tools-bin/</code></p>



<a name="242716311"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242716311" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242716311">(Jun 15 2021 at 10:52)</a>:</h4>
<p>see I don't have <code>stage1-tools-bin</code></p>



<a name="242716357"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242716357" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242716357">(Jun 15 2021 at 10:53)</a>:</h4>
<p>nor have I any cargo binaries</p>



<a name="242716382"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242716382" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Oliver Braunsdorf <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242716382">(Jun 15 2021 at 10:53)</a>:</h4>
<p>okay..strange :D</p>



<a name="242716445"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242716445" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242716445">(Jun 15 2021 at 10:54)</a>:</h4>
<p><code>build</code> doesn't create a full sysroot I don't think</p>



<a name="242716458"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242716458" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242716458">(Jun 15 2021 at 10:54)</a>:</h4>
<p>try <code>dist --stage 1</code> and see if it helps</p>



<a name="242716534"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242716534" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242716534">(Jun 15 2021 at 10:55)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/issues/81431">https://github.com/rust-lang/rust/issues/81431</a></p>



<a name="242716681"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242716681" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242716681">(Jun 15 2021 at 10:56)</a>:</h4>
<p>maybe the <code>x.py build cargo</code> didn't completely finish what's required for the rustup toolchain to work and there's an incomplete toolchain rn ?</p>



<a name="242716801"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242716801" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242716801">(Jun 15 2021 at 10:58)</a>:</h4>
<p><span class="user-mention" data-user-id="116113">@lqd</span> cargo is  built, but it's not in the sysroot directory because x.py doesn't use it for bootstrapping stage 2</p>



<a name="242716843"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242716843" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242716843">(Jun 15 2021 at 10:58)</a>:</h4>
<p>you can copy it manually into stage1/bin but x.py might delete it without noticing</p>



<a name="242716862"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242716862" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242716862">(Jun 15 2021 at 10:58)</a>:</h4>
<p>oh ok</p>



<a name="242716906"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242716906" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242716906">(Jun 15 2021 at 10:59)</a>:</h4>
<p><span class="user-mention" data-user-id="245622">@Oliver Braunsdorf</span> you built with <code>build --stage 1 src/tools</code> or sometihng like that, right?</p>



<a name="242717060"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242717060" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Oliver Braunsdorf <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242717060">(Jun 15 2021 at 11:00)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/rustup.20toolchain.20link.20-.20cargo.3F/near/242716906">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="245622">Oliver Braunsdorf</span> you built with <code>build --stage 1 src/tools</code> or sometihng like that, right?</p>
</blockquote>
<p>yes, right. Here is the exact command that I used: <code>./x.py build -j$(nproc) --stage 1 -i library/std cargo</code><br>
`</p>



<a name="242717091"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242717091" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242717091">(Jun 15 2021 at 11:01)</a>:</h4>
<p>that does not do what you want</p>



<a name="242717096"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242717096" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242717096">(Jun 15 2021 at 11:01)</a>:</h4>
<p><del>it builds the compiler twice and cargo 0 times</del></p>



<a name="242717121"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242717121" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Oliver Braunsdorf <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242717121">(Jun 15 2021 at 11:01)</a>:</h4>
<p>ah okay. So I need the <code>dist</code> command?</p>



<a name="242717133"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242717133" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242717133">(Jun 15 2021 at 11:01)</a>:</h4>
<p>I would recommend the dist command, yes</p>



<a name="242717194"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242717194" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242717194">(Jun 15 2021 at 11:02)</a>:</h4>
<p>in general it's the only one guaranteed to generate a sysroot with everything</p>



<a name="242717224"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242717224" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Oliver Braunsdorf <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242717224">(Jun 15 2021 at 11:02)</a>:</h4>
<p>okay, I will try that right now, thanks! :)<br>
can you tell me which targets to append to this command in order to have cargo, rustc, libstd and all other essentials but without building the docs etc.?</p>



<a name="242717345"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242717345" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242717345">(Jun 15 2021 at 11:04)</a>:</h4>
<p>there should be an <code>--exclude rust-docs</code> flag or something like that</p>



<a name="242717575"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242717575" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242717575">(Jun 15 2021 at 11:07)</a>:</h4>
<p><span class="user-mention" data-user-id="232545">@Joshua Nelson</span> which cargo is used if you toolchain link your local build without asking to build cargo with x.py ? stage0's ?</p>



<a name="242717584"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242717584" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242717584">(Jun 15 2021 at 11:07)</a>:</h4>
<p>I believe so</p>



<a name="242717595"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242717595" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Oliver Braunsdorf <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242717595">(Jun 15 2021 at 11:07)</a>:</h4>
<p>after the dist-command completed, where should I expect the rustc and cargo binaries? And should I use the <code>rustup toolchain link</code> to get what i want?</p>



<a name="242717596"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242717596" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242717596">(Jun 15 2021 at 11:07)</a>:</h4>
<p>but I'm' not sure</p>



<a name="242717604"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242717604" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242717604">(Jun 15 2021 at 11:07)</a>:</h4>
<p>you can try it yourself</p>



<a name="242717695"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242717695" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242717695">(Jun 15 2021 at 11:08)</a>:</h4>
<p>it seems to me that depending on what they need, building cargo or x.py dist may be unnecessary here</p>



<a name="242717714"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242717714" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Oliver Braunsdorf <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242717714">(Jun 15 2021 at 11:08)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116113">lqd</span> <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/rustup.20toolchain.20link.20-.20cargo.3F/near/242717575">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> which cargo is used if you toolchain link your local build without asking to build cargo with x.py ? stage0's ?</p>
</blockquote>
<p>maybe the cargo binary of your default rustup toolchain</p>



<a name="242717720"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242717720" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242717720">(Jun 15 2021 at 11:08)</a>:</h4>
<p>maybe</p>



<a name="242717734"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242717734" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242717734">(Jun 15 2021 at 11:08)</a>:</h4>
<p>well I don't know why you would need cargo from rust-lang/rust unless you want a full sysroot</p>



<a name="242717743"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242717743" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242717743">(Jun 15 2021 at 11:08)</a>:</h4>
<p>and your nightly seems super old</p>



<a name="242717793"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242717793" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Oliver Braunsdorf <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242717793">(Jun 15 2021 at 11:09)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116113">lqd</span> <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/rustup.20toolchain.20link.20-.20cargo.3F/near/242717743">said</a>:</p>
<blockquote>
<p>and your nightly seems super old</p>
</blockquote>
<p>yes, I worked with a super old compiler version and did not update my rustup nightly toolchain</p>



<a name="242717886"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242717886" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242717886">(Jun 15 2021 at 11:10)</a>:</h4>
<p>at least <code>dist</code> should work in all cases as joshua said <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="242717951"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242717951" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> hyd-dev <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242717951">(Jun 15 2021 at 11:11)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116113">lqd</span> <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/rustup.20toolchain.20link.20-.20cargo.3F/near/242717575">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> which cargo is used if you toolchain link your local build without asking to build cargo with x.py ? stage0's ?</p>
</blockquote>
<p>According to <a href="https://rust-lang.github.io/rustup/concepts/toolchains.html#custom-toolchains">https://rust-lang.github.io/rustup/concepts/toolchains.html#custom-toolchains</a>:</p>
<blockquote>
<p>Because the <code>rust-lang/rust</code> tree does not include Cargo, <em>when <code>cargo</code> is invoked for a custom toolchain and it is not available, <code>rustup</code> will attempt to use <code>cargo</code> from one of the release channels</em>, preferring 'nightly', then 'beta' or 'stable'.</p>
</blockquote>



<a name="242722108"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242722108" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Oliver Braunsdorf <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242722108">(Jun 15 2021 at 12:02)</a>:</h4>
<p><span class="user-mention" data-user-id="232545">@Joshua Nelson</span> the <code>x.py dist</code> completed. However, it seems like everything is bundled in rust/build/dist as compressed archives. Is this to be expected? <br>
I guess I would rather need <code>x.py install</code> to install rustc, cargo and everything else to a directory where I can set my <code>$PATH</code> variable to, right?</p>



<a name="242722133"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rustup%20toolchain%20link%20-%20cargo%3F/near/242722133" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rustup.20toolchain.20link.20-.20cargo.3F.html#242722133">(Jun 15 2021 at 12:02)</a>:</h4>
<p>that should work</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>